how to find max value in array javascript